#include "queue.h"

void queue::put(boost::shared_ptr<message> m) 
{
	boost::mutex::scoped_lock l(_mutex);
	_list.push_back(m);
}

boost::shared_ptr<message> queue::get()
{
	boost::mutex::scoped_lock l(_mutex);
	if(_list.empty()) {
		return boost::shared_ptr<message>();
	}
	boost::shared_ptr<message> m(_list.back());
	_list.pop_back();
	return m;
}

